﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Server.Model;
using System.Data;

namespace Server.Data
{
    public class PlanDAO : BaseDAO
    {
        public DayPlan GetDayPlan(DateTime pDay)
        {
            DayPlan ret = new DayPlan();
            ret.Date = pDay;
            DataTable dt = base.ExecuteDataTable("sp_Get_Plan_DayPlan", pDay);
            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    PlanItem item = new PlanItem();
                    item.AllowUsePC = row["AllowUsePC"].ToString();
                    item.EndTime = row["EndTime"].ToString();
                    item.StartTime = row["StartTime"].ToString();

                    ret.PlanItems.Add(item);
                }
            }

            return ret;
        }
    }
}
